#ifndef BUFFERWRITER_H
#define BUFFERWRITER_H

#include <string>
#include "Types.h"

using std::string;

class BufferWriter {
public:
	BufferWriter();
	~BufferWriter();
	void addByte(int8_t byte);
	void setByte(int8_t byte, int32_t pos);
	void addShort(int16_t shrt);
	void setShort(int16_t shrt, int32_t pos);
	void addInt(int32_t intg);
	void setInt(int32_t intg, int32_t pos);
	void addLong(int64_t lng);
	void setLong(int64_t lng, int32_t pos);
	void addString(const string &stri);
	void addDouble(double dbl);
	void setDouble(double dbl, int32_t pos);
	uint8_t *getBuffer();
	uint32_t getPos();
private:
	uint32_t pos;
	uint8_t buffer[65536];
};

#endif
